{extend name="public/base" /}

{block name="title"}<title>{$Think.lang.list}</title>{/block}

{block name="pjax_container"}
<div class="hry-content-wrapper">
    <section class="content-header">
        <ol class="breadcrumb">
            <li>会员管理</li>
            <li>会员列表</li>
            <li>订单详情</li>
            <li class="active">变更订单</li>
        </ol>
    </section>
    <section class="content">
        <div class="top_box">
            <div>用户: {$user_info.username}</div>
            <div>累计认投金额: {$total_money}</div>
            <div class="dao_chu" id="sure_change"  data-oid="{$order_id}">确认变更</div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <div class="hry-form-wrapper">
                    <div class="box-body table-responsive">
                        <table class="table table-bordered table-hover table-sort">
                            <tr>
                                <th>项目名称</th>
                                <th>姓名</th>
                                <th>手机号码</th>
                                <th>认投金额</th>
                                <th width="178">{$Think.lang.action}</th>
                            </tr>

                            <tr>
                              <td>{$order_info.project_name}</td>
                              <td>{$user_info.username}</td>
                              <td>{$user_info.mobile}</td>
                              <td>{$order_info.money}</td>
                            </tr>
                            <tr></tr>
                            <tr></tr>
                            <tr></tr>
                            <tr>
                                <td>{$order_info.project_name}</td>
                                <td>
                                    <input class="form-control" id="change_name" type="text" maxlength="30" value="" placeholder="请输入姓名">
                                </td>
                                <td>
                                    <input class="form-control" id="change_mobile" type="text" maxlength="=11"  value="" placeholder="请输入手机号">
                                </td>
                                <td>{$order_info.money}</td>
                            </tr>

                        </table>
                    </div>

                </div>
            </div>


        </div>
    </section>
</div>

<script type="text/javascript">
    $(function(){
        /*ajax页面加载icheck，有该控件的页面才需要*/
        $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
            checkboxClass: 'icheckbox_minimal-blue',
            radioClass: 'iradio_minimal-blue'
        });
        {if condition=" $rest_login == 1 "}
        restlogin('{$rest_login_info}');   //登录超时
        {/if}
    });
    $("#sure_change").on('click','',function(){ //项目授权
        oid=$(this).data('oid');
        name=$('#change_name').val();
        mobile=$('#change_mobile').val();
         reg= /^[1][2,3,4,5,6,7,8,9][0-9]{9}$/;
        if(mobile==='' || oid==='' ){
            $.amaran({'message':'请输入完整的账户信息'});
            return
        }
        if(!reg.test(mobile)){
            $.amaran({'message':'请输入正确的手机号'});
            return
        }
//        $res=confirm('是否确定对该笔订单做变更？');
//        if($res){
            $.ajax({
                url: '/hryweb.php/member/orderChange',
                data: {'order_id':oid,'name':name,'mobile':mobile},
                type: "POST",
                dataType: "json",
                success: function (result) {
                    if (result.status == 1) {
                        $.amaran({'message': result.info});
                        window.location.href = result.url;
                    } else {
                        $.amaran({'message': result.info});
                    }
                },
                async:true
            });

//        }
    });


</script>

<style type="text/css">
    .top_box{
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        font-size: 20px;
    }
    .dao_chu{
        font-size: 18px;
        width: 100px;
        height: 30px;
        color: #ffffff;
        background-color: #00a7d0;
        border-radius: 5px;
        text-align: center;
        line-height: 30px;
    }
</style>


{/block}